Specify the tissue of interest, run the boilerplate code which sets up the functions and environment, load the tissue object.
tissue_of_interest = "Heart"
library(here)
source(here("00_data_ingest", "02_tissue_analysis_rmd", "boilerplate.R"))
tiss=load_tissue_droplet(tissue_of_interest)
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
[1] "Scaling data matrix"
|
| | 0%
|
|================================================================================| 100%
Calculating gene means
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variance to mean ratios
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Visualize top genes in principal components
Later on (in FindClusters and TSNE) you will pick a number of principal components to use. This has the effect of keeping the major directions of variation in the data and, ideally, supressing noise. There is no correct answer to the number to use, but a decent rule of thumb is to go until the plot plateaus.
PCElbowPlot(object = tiss)
Choose the number of principal components to use.
# Set number of principal components.
n.pcs = 15
The clustering is performed based on a nearest neighbors graph. Cells that have similar expression will be joined together. The Louvain algorithm looks for groups of cells with high modularity–more connections within the group than between groups. The resolution parameter determines the scale…higher resolution will give more clusters, lower resolution will give fewer.
For the top-level clustering, aim to under-cluster instead of over-cluster. It will be easy to subset groups and further analyze them below.
# Set resolution
res.used <- 0.5
tiss <- FindClusters(object = tiss, reduction.type = "pca", dims.use = 1:n.pcs,
resolution = res.used, print.output = 0, save.SNN = TRUE)
To visualize
# If cells are too spread out, you can raise the perplexity. If you have few cells, try a lower perplexity (but never less than 10).
tiss <- RunTSNE(object = tiss, dims.use = 1:n.pcs, seed.use = 10, perplexity=30, dim.embed = 2)
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = tiss, do.label = T)
Check expression of genes of interset.
Dotplots let you see the intensity of exppression and the fraction of cells expressing for each of your genes of interest.
How big are the clusters?
table(tiss@ident)
0 1 2 3 4 5
177 147 96 81 63 60
Which markers identify a specific cluster?
clust.markers <- FindMarkers(object = tiss, ident.1 = 2, ident.2 = 1, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~04s
|++ | 2 % ~04s
|++ | 3 % ~04s
|+++ | 4 % ~04s
|+++ | 5 % ~04s
|++++ | 6 % ~04s
|++++ | 7 % ~04s
|+++++ | 8 % ~04s
|+++++ | 9 % ~04s
|++++++ | 10% ~04s
|++++++ | 11% ~04s
|+++++++ | 12% ~04s
|+++++++ | 13% ~04s
|++++++++ | 14% ~04s
|++++++++ | 15% ~04s
|+++++++++ | 16% ~04s
|+++++++++ | 17% ~04s
|++++++++++ | 18% ~04s
|++++++++++ | 19% ~04s
|+++++++++++ | 20% ~04s
|+++++++++++ | 21% ~03s
|++++++++++++ | 22% ~03s
|++++++++++++ | 23% ~03s
|+++++++++++++ | 24% ~03s
|+++++++++++++ | 26% ~03s
|++++++++++++++ | 27% ~03s
|++++++++++++++ | 28% ~03s
|+++++++++++++++ | 29% ~03s
|+++++++++++++++ | 30% ~03s
|++++++++++++++++ | 31% ~03s
|++++++++++++++++ | 32% ~03s
|+++++++++++++++++ | 33% ~03s
|+++++++++++++++++ | 34% ~03s
|++++++++++++++++++ | 35% ~03s
|++++++++++++++++++ | 36% ~03s
|+++++++++++++++++++ | 37% ~03s
|+++++++++++++++++++ | 38% ~03s
|++++++++++++++++++++ | 39% ~03s
|++++++++++++++++++++ | 40% ~03s
|+++++++++++++++++++++ | 41% ~03s
|+++++++++++++++++++++ | 42% ~02s
|++++++++++++++++++++++ | 43% ~02s
|++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|+++++++++++++++++++++++ | 46% ~02s
|++++++++++++++++++++++++ | 47% ~02s
|++++++++++++++++++++++++ | 48% ~02s
|+++++++++++++++++++++++++ | 49% ~02s
|+++++++++++++++++++++++++ | 50% ~02s
|++++++++++++++++++++++++++ | 51% ~02s
|+++++++++++++++++++++++++++ | 52% ~02s
|+++++++++++++++++++++++++++ | 53% ~02s
|++++++++++++++++++++++++++++ | 54% ~02s
|++++++++++++++++++++++++++++ | 55% ~02s
|+++++++++++++++++++++++++++++ | 56% ~02s
|+++++++++++++++++++++++++++++ | 57% ~02s
|++++++++++++++++++++++++++++++ | 58% ~02s
|++++++++++++++++++++++++++++++ | 59% ~02s
|+++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|++++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 63% ~02s
|+++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|++++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 04s
print(x = head(x= clust.markers, n = 10))
You can also compute all markers for all clusters at once. This may take some time.
tiss.markers <- FindAllMarkers(object = tiss, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~11s
|++ | 2 % ~11s
|++ | 3 % ~12s
|+++ | 4 % ~12s
|+++ | 5 % ~12s
|++++ | 6 % ~12s
|++++ | 7 % ~12s
|+++++ | 8 % ~12s
|+++++ | 9 % ~12s
|++++++ | 10% ~11s
|++++++ | 11% ~11s
|+++++++ | 12% ~11s
|+++++++ | 13% ~11s
|++++++++ | 14% ~10s
|++++++++ | 15% ~10s
|+++++++++ | 16% ~10s
|+++++++++ | 18% ~10s
|++++++++++ | 19% ~09s
|++++++++++ | 20% ~09s
|+++++++++++ | 21% ~09s
|+++++++++++ | 22% ~09s
|++++++++++++ | 23% ~09s
|++++++++++++ | 24% ~09s
|+++++++++++++ | 25% ~08s
|+++++++++++++ | 26% ~08s
|++++++++++++++ | 27% ~08s
|++++++++++++++ | 28% ~08s
|+++++++++++++++ | 29% ~08s
|+++++++++++++++ | 30% ~08s
|++++++++++++++++ | 31% ~08s
|++++++++++++++++ | 32% ~07s
|+++++++++++++++++ | 33% ~07s
|++++++++++++++++++ | 34% ~07s
|++++++++++++++++++ | 35% ~07s
|+++++++++++++++++++ | 36% ~07s
|+++++++++++++++++++ | 37% ~07s
|++++++++++++++++++++ | 38% ~07s
|++++++++++++++++++++ | 39% ~07s
|+++++++++++++++++++++ | 40% ~06s
|+++++++++++++++++++++ | 41% ~06s
|++++++++++++++++++++++ | 42% ~06s
|++++++++++++++++++++++ | 43% ~06s
|+++++++++++++++++++++++ | 44% ~06s
|+++++++++++++++++++++++ | 45% ~06s
|++++++++++++++++++++++++ | 46% ~06s
|++++++++++++++++++++++++ | 47% ~06s
|+++++++++++++++++++++++++ | 48% ~06s
|+++++++++++++++++++++++++ | 49% ~05s
|++++++++++++++++++++++++++ | 51% ~05s
|++++++++++++++++++++++++++ | 52% ~05s
|+++++++++++++++++++++++++++ | 53% ~05s
|+++++++++++++++++++++++++++ | 54% ~05s
|++++++++++++++++++++++++++++ | 55% ~05s
|++++++++++++++++++++++++++++ | 56% ~05s
|+++++++++++++++++++++++++++++ | 57% ~05s
|+++++++++++++++++++++++++++++ | 58% ~05s
|++++++++++++++++++++++++++++++ | 59% ~04s
|++++++++++++++++++++++++++++++ | 60% ~04s
|+++++++++++++++++++++++++++++++ | 61% ~04s
|+++++++++++++++++++++++++++++++ | 62% ~04s
|++++++++++++++++++++++++++++++++ | 63% ~04s
|++++++++++++++++++++++++++++++++ | 64% ~04s
|+++++++++++++++++++++++++++++++++ | 65% ~04s
|+++++++++++++++++++++++++++++++++ | 66% ~04s
|++++++++++++++++++++++++++++++++++ | 67% ~04s
|+++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|++++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~03s
|+++++++++++++++++++++++++++++++++++++ | 72% ~03s
|+++++++++++++++++++++++++++++++++++++ | 73% ~03s
|++++++++++++++++++++++++++++++++++++++ | 74% ~03s
|++++++++++++++++++++++++++++++++++++++ | 75% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 11s
| | 0 % ~calculating
|+ | 1 % ~09s
|++ | 2 % ~08s
|++ | 3 % ~08s
|+++ | 4 % ~08s
|+++ | 5 % ~08s
|++++ | 6 % ~08s
|++++ | 7 % ~08s
|+++++ | 8 % ~08s
|+++++ | 9 % ~07s
|++++++ | 10% ~07s
|++++++ | 11% ~07s
|+++++++ | 12% ~07s
|+++++++ | 13% ~07s
|++++++++ | 14% ~07s
|++++++++ | 15% ~07s
|+++++++++ | 16% ~07s
|+++++++++ | 17% ~07s
|++++++++++ | 18% ~07s
|++++++++++ | 19% ~07s
|+++++++++++ | 20% ~06s
|+++++++++++ | 21% ~06s
|++++++++++++ | 22% ~06s
|++++++++++++ | 23% ~06s
|+++++++++++++ | 24% ~06s
|+++++++++++++ | 26% ~06s
|++++++++++++++ | 27% ~06s
|++++++++++++++ | 28% ~06s
|+++++++++++++++ | 29% ~06s
|+++++++++++++++ | 30% ~06s
|++++++++++++++++ | 31% ~06s
|++++++++++++++++ | 32% ~06s
|+++++++++++++++++ | 33% ~06s
|+++++++++++++++++ | 34% ~06s
|++++++++++++++++++ | 35% ~05s
|++++++++++++++++++ | 36% ~05s
|+++++++++++++++++++ | 37% ~05s
|+++++++++++++++++++ | 38% ~05s
|++++++++++++++++++++ | 39% ~05s
|++++++++++++++++++++ | 40% ~05s
|+++++++++++++++++++++ | 41% ~05s
|+++++++++++++++++++++ | 42% ~05s
|++++++++++++++++++++++ | 43% ~05s
|++++++++++++++++++++++ | 44% ~05s
|+++++++++++++++++++++++ | 45% ~05s
|+++++++++++++++++++++++ | 46% ~05s
|++++++++++++++++++++++++ | 47% ~04s
|++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|+++++++++++++++++++++++++ | 50% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|+++++++++++++++++++++++++++ | 52% ~04s
|+++++++++++++++++++++++++++ | 53% ~04s
|++++++++++++++++++++++++++++ | 54% ~04s
|++++++++++++++++++++++++++++ | 55% ~04s
|+++++++++++++++++++++++++++++ | 56% ~04s
|+++++++++++++++++++++++++++++ | 57% ~04s
|++++++++++++++++++++++++++++++ | 58% ~04s
|++++++++++++++++++++++++++++++ | 59% ~03s
|+++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|++++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|+++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|++++++++++++++++++++++++++++++++++ | 66% ~03s
|++++++++++++++++++++++++++++++++++ | 67% ~03s
|+++++++++++++++++++++++++++++++++++ | 68% ~03s
|+++++++++++++++++++++++++++++++++++ | 69% ~03s
|++++++++++++++++++++++++++++++++++++ | 70% ~03s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|+++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|++++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 09s
| | 0 % ~calculating
|+ | 1 % ~06s
|++ | 2 % ~06s
|++ | 3 % ~06s
|+++ | 4 % ~06s
|+++ | 5 % ~06s
|++++ | 6 % ~06s
|++++ | 7 % ~05s
|+++++ | 8 % ~05s
|+++++ | 9 % ~05s
|++++++ | 10% ~05s
|++++++ | 11% ~05s
|+++++++ | 12% ~05s
|+++++++ | 13% ~05s
|++++++++ | 14% ~05s
|++++++++ | 15% ~05s
|+++++++++ | 16% ~05s
|+++++++++ | 17% ~05s
|++++++++++ | 18% ~05s
|++++++++++ | 19% ~05s
|+++++++++++ | 20% ~05s
|+++++++++++ | 21% ~05s
|++++++++++++ | 22% ~05s
|++++++++++++ | 23% ~05s
|+++++++++++++ | 24% ~05s
|+++++++++++++ | 26% ~04s
|++++++++++++++ | 27% ~04s
|++++++++++++++ | 28% ~04s
|+++++++++++++++ | 29% ~04s
|+++++++++++++++ | 30% ~04s
|++++++++++++++++ | 31% ~04s
|++++++++++++++++ | 32% ~04s
|+++++++++++++++++ | 33% ~04s
|+++++++++++++++++ | 34% ~04s
|++++++++++++++++++ | 35% ~04s
|++++++++++++++++++ | 36% ~04s
|+++++++++++++++++++ | 37% ~04s
|+++++++++++++++++++ | 38% ~04s
|++++++++++++++++++++ | 39% ~04s
|++++++++++++++++++++ | 40% ~04s
|+++++++++++++++++++++ | 41% ~04s
|+++++++++++++++++++++ | 42% ~04s
|++++++++++++++++++++++ | 43% ~03s
|++++++++++++++++++++++ | 44% ~03s
|+++++++++++++++++++++++ | 45% ~03s
|+++++++++++++++++++++++ | 46% ~03s
|++++++++++++++++++++++++ | 47% ~03s
|++++++++++++++++++++++++ | 48% ~03s
|+++++++++++++++++++++++++ | 49% ~03s
|+++++++++++++++++++++++++ | 50% ~03s
|++++++++++++++++++++++++++ | 51% ~03s
|+++++++++++++++++++++++++++ | 52% ~03s
|+++++++++++++++++++++++++++ | 53% ~03s
|++++++++++++++++++++++++++++ | 54% ~03s
|++++++++++++++++++++++++++++ | 55% ~03s
|+++++++++++++++++++++++++++++ | 56% ~03s
|+++++++++++++++++++++++++++++ | 57% ~03s
|++++++++++++++++++++++++++++++ | 58% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|+++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|++++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 63% ~02s
|+++++++++++++++++++++++++++++++++ | 64% ~02s
|+++++++++++++++++++++++++++++++++ | 65% ~02s
|++++++++++++++++++++++++++++++++++ | 66% ~02s
|++++++++++++++++++++++++++++++++++ | 67% ~02s
|+++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 69% ~02s
|++++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|+++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|++++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 06s
| | 0 % ~calculating
|+ | 1 % ~14s
|++ | 2 % ~13s
|++ | 3 % ~13s
|+++ | 4 % ~13s
|+++ | 5 % ~12s
|++++ | 6 % ~12s
|++++ | 7 % ~12s
|+++++ | 8 % ~12s
|+++++ | 9 % ~12s
|++++++ | 10% ~12s
|++++++ | 11% ~12s
|+++++++ | 12% ~12s
|+++++++ | 13% ~12s
|++++++++ | 14% ~12s
|++++++++ | 15% ~11s
|+++++++++ | 16% ~11s
|+++++++++ | 17% ~11s
|++++++++++ | 18% ~11s
|++++++++++ | 19% ~11s
|+++++++++++ | 20% ~11s
|+++++++++++ | 21% ~10s
|++++++++++++ | 22% ~10s
|++++++++++++ | 23% ~10s
|+++++++++++++ | 24% ~10s
|+++++++++++++ | 25% ~10s
|++++++++++++++ | 26% ~10s
|++++++++++++++ | 27% ~10s
|+++++++++++++++ | 28% ~10s
|+++++++++++++++ | 29% ~09s
|++++++++++++++++ | 30% ~09s
|++++++++++++++++ | 31% ~09s
|+++++++++++++++++ | 32% ~09s
|+++++++++++++++++ | 33% ~09s
|++++++++++++++++++ | 34% ~09s
|++++++++++++++++++ | 35% ~09s
|+++++++++++++++++++ | 36% ~09s
|+++++++++++++++++++ | 37% ~08s
|++++++++++++++++++++ | 38% ~08s
|++++++++++++++++++++ | 39% ~08s
|+++++++++++++++++++++ | 40% ~08s
|+++++++++++++++++++++ | 41% ~08s
|++++++++++++++++++++++ | 42% ~08s
|++++++++++++++++++++++ | 43% ~08s
|+++++++++++++++++++++++ | 44% ~07s
|+++++++++++++++++++++++ | 45% ~07s
|++++++++++++++++++++++++ | 46% ~07s
|++++++++++++++++++++++++ | 47% ~07s
|+++++++++++++++++++++++++ | 48% ~07s
|+++++++++++++++++++++++++ | 49% ~07s
|++++++++++++++++++++++++++ | 51% ~07s
|++++++++++++++++++++++++++ | 52% ~07s
|+++++++++++++++++++++++++++ | 53% ~06s
|+++++++++++++++++++++++++++ | 54% ~06s
|++++++++++++++++++++++++++++ | 55% ~06s
|++++++++++++++++++++++++++++ | 56% ~06s
|+++++++++++++++++++++++++++++ | 57% ~06s
|+++++++++++++++++++++++++++++ | 58% ~06s
|++++++++++++++++++++++++++++++ | 59% ~06s
|++++++++++++++++++++++++++++++ | 60% ~05s
|+++++++++++++++++++++++++++++++ | 61% ~05s
|+++++++++++++++++++++++++++++++ | 62% ~05s
|++++++++++++++++++++++++++++++++ | 63% ~05s
|++++++++++++++++++++++++++++++++ | 64% ~05s
|+++++++++++++++++++++++++++++++++ | 65% ~05s
|+++++++++++++++++++++++++++++++++ | 66% ~05s
|++++++++++++++++++++++++++++++++++ | 67% ~05s
|++++++++++++++++++++++++++++++++++ | 68% ~04s
|+++++++++++++++++++++++++++++++++++ | 69% ~04s
|+++++++++++++++++++++++++++++++++++ | 70% ~04s
|++++++++++++++++++++++++++++++++++++ | 71% ~04s
|++++++++++++++++++++++++++++++++++++ | 72% ~04s
|+++++++++++++++++++++++++++++++++++++ | 73% ~04s
|+++++++++++++++++++++++++++++++++++++ | 74% ~04s
|++++++++++++++++++++++++++++++++++++++ | 75% ~03s
|++++++++++++++++++++++++++++++++++++++ | 76% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~03s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~03s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~03s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~02s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~02s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~02s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 14s
| | 0 % ~calculating
|+ | 1 % ~08s
|++ | 2 % ~07s
|++ | 3 % ~07s
|+++ | 4 % ~07s
|+++ | 5 % ~07s
|++++ | 7 % ~07s
|++++ | 8 % ~06s
|+++++ | 9 % ~06s
|+++++ | 10% ~06s
|++++++ | 11% ~06s
|++++++ | 12% ~06s
|+++++++ | 13% ~06s
|++++++++ | 14% ~06s
|++++++++ | 15% ~06s
|+++++++++ | 16% ~06s
|+++++++++ | 17% ~06s
|++++++++++ | 18% ~06s
|++++++++++ | 20% ~06s
|+++++++++++ | 21% ~06s
|+++++++++++ | 22% ~06s
|++++++++++++ | 23% ~05s
|++++++++++++ | 24% ~05s
|+++++++++++++ | 25% ~05s
|++++++++++++++ | 26% ~05s
|++++++++++++++ | 27% ~05s
|+++++++++++++++ | 28% ~05s
|+++++++++++++++ | 29% ~05s
|++++++++++++++++ | 30% ~05s
|++++++++++++++++ | 32% ~05s
|+++++++++++++++++ | 33% ~05s
|+++++++++++++++++ | 34% ~05s
|++++++++++++++++++ | 35% ~05s
|++++++++++++++++++ | 36% ~05s
|+++++++++++++++++++ | 37% ~04s
|++++++++++++++++++++ | 38% ~04s
|++++++++++++++++++++ | 39% ~04s
|+++++++++++++++++++++ | 40% ~04s
|+++++++++++++++++++++ | 41% ~04s
|++++++++++++++++++++++ | 42% ~04s
|++++++++++++++++++++++ | 43% ~04s
|+++++++++++++++++++++++ | 45% ~04s
|+++++++++++++++++++++++ | 46% ~04s
|++++++++++++++++++++++++ | 47% ~04s
|++++++++++++++++++++++++ | 48% ~04s
|+++++++++++++++++++++++++ | 49% ~04s
|+++++++++++++++++++++++++ | 50% ~04s
|++++++++++++++++++++++++++ | 51% ~04s
|+++++++++++++++++++++++++++ | 52% ~03s
|+++++++++++++++++++++++++++ | 53% ~03s
|++++++++++++++++++++++++++++ | 54% ~03s
|++++++++++++++++++++++++++++ | 55% ~03s
|+++++++++++++++++++++++++++++ | 57% ~03s
|+++++++++++++++++++++++++++++ | 58% ~03s
|++++++++++++++++++++++++++++++ | 59% ~03s
|++++++++++++++++++++++++++++++ | 60% ~03s
|+++++++++++++++++++++++++++++++ | 61% ~03s
|+++++++++++++++++++++++++++++++ | 62% ~03s
|++++++++++++++++++++++++++++++++ | 63% ~03s
|+++++++++++++++++++++++++++++++++ | 64% ~03s
|+++++++++++++++++++++++++++++++++ | 65% ~03s
|++++++++++++++++++++++++++++++++++ | 66% ~02s
|++++++++++++++++++++++++++++++++++ | 67% ~02s
|+++++++++++++++++++++++++++++++++++ | 68% ~02s
|+++++++++++++++++++++++++++++++++++ | 70% ~02s
|++++++++++++++++++++++++++++++++++++ | 71% ~02s
|++++++++++++++++++++++++++++++++++++ | 72% ~02s
|+++++++++++++++++++++++++++++++++++++ | 73% ~02s
|+++++++++++++++++++++++++++++++++++++ | 74% ~02s
|++++++++++++++++++++++++++++++++++++++ | 75% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 76% ~02s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 78% ~02s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~02s
|+++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 90% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 07s
| | 0 % ~calculating
|+ | 1 % ~19s
|++ | 2 % ~18s
|++ | 3 % ~17s
|+++ | 4 % ~17s
|+++ | 5 % ~18s
|++++ | 6 % ~17s
|++++ | 7 % ~17s
|+++++ | 8 % ~17s
|+++++ | 9 % ~17s
|++++++ | 10% ~16s
|++++++ | 11% ~16s
|+++++++ | 12% ~16s
|+++++++ | 13% ~16s
|++++++++ | 14% ~16s
|++++++++ | 15% ~15s
|+++++++++ | 16% ~15s
|+++++++++ | 17% ~15s
|++++++++++ | 18% ~15s
|++++++++++ | 19% ~15s
|+++++++++++ | 20% ~14s
|+++++++++++ | 21% ~14s
|++++++++++++ | 22% ~14s
|++++++++++++ | 23% ~14s
|+++++++++++++ | 24% ~14s
|+++++++++++++ | 26% ~14s
|++++++++++++++ | 27% ~13s
|++++++++++++++ | 28% ~13s
|+++++++++++++++ | 29% ~13s
|+++++++++++++++ | 30% ~13s
|++++++++++++++++ | 31% ~13s
|++++++++++++++++ | 32% ~12s
|+++++++++++++++++ | 33% ~12s
|+++++++++++++++++ | 34% ~12s
|++++++++++++++++++ | 35% ~12s
|++++++++++++++++++ | 36% ~12s
|+++++++++++++++++++ | 37% ~12s
|+++++++++++++++++++ | 38% ~11s
|++++++++++++++++++++ | 39% ~11s
|++++++++++++++++++++ | 40% ~11s
|+++++++++++++++++++++ | 41% ~11s
|+++++++++++++++++++++ | 42% ~11s
|++++++++++++++++++++++ | 43% ~10s
|++++++++++++++++++++++ | 44% ~10s
|+++++++++++++++++++++++ | 45% ~10s
|+++++++++++++++++++++++ | 46% ~10s
|++++++++++++++++++++++++ | 47% ~10s
|++++++++++++++++++++++++ | 48% ~10s
|+++++++++++++++++++++++++ | 49% ~09s
|+++++++++++++++++++++++++ | 50% ~09s
|++++++++++++++++++++++++++ | 51% ~09s
|+++++++++++++++++++++++++++ | 52% ~09s
|+++++++++++++++++++++++++++ | 53% ~09s
|++++++++++++++++++++++++++++ | 54% ~08s
|++++++++++++++++++++++++++++ | 55% ~08s
|+++++++++++++++++++++++++++++ | 56% ~08s
|+++++++++++++++++++++++++++++ | 57% ~08s
|++++++++++++++++++++++++++++++ | 58% ~08s
|++++++++++++++++++++++++++++++ | 59% ~08s
|+++++++++++++++++++++++++++++++ | 60% ~07s
|+++++++++++++++++++++++++++++++ | 61% ~07s
|++++++++++++++++++++++++++++++++ | 62% ~07s
|++++++++++++++++++++++++++++++++ | 63% ~07s
|+++++++++++++++++++++++++++++++++ | 64% ~07s
|+++++++++++++++++++++++++++++++++ | 65% ~06s
|++++++++++++++++++++++++++++++++++ | 66% ~06s
|++++++++++++++++++++++++++++++++++ | 67% ~06s
|+++++++++++++++++++++++++++++++++++ | 68% ~06s
|+++++++++++++++++++++++++++++++++++ | 69% ~06s
|++++++++++++++++++++++++++++++++++++ | 70% ~06s
|++++++++++++++++++++++++++++++++++++ | 71% ~05s
|+++++++++++++++++++++++++++++++++++++ | 72% ~05s
|+++++++++++++++++++++++++++++++++++++ | 73% ~05s
|++++++++++++++++++++++++++++++++++++++ | 74% ~05s
|++++++++++++++++++++++++++++++++++++++ | 76% ~05s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~04s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~04s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~04s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~03s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~03s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~03s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~02s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~02s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~01s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 19s
Display the top markers you computed above.
#tiss.markers %>% group_by(cluster) %>% top_n(5, avg_diff)
At a coarse level, we can use canonical markers to match the unbiased clustering to known cell types:
0: Coronary_vascular_EDC 1: Fb 2: Fb_SMC 3: Blood_Cells 4: Endocardial_EDC 5: CMs
# stash current cluster IDs
tiss <- StashIdent(object = tiss, save.name = "cluster.ids")
# enumerate current cluster IDs and the labels for them
cluster.ids <- c(0, 1, 2, 3, 4, 5)
cell_ontology_class <- c("endothelial cell", "fibroblast", "Fb_SMC", "erythrocyte", "endocardial cell", "cardiac muscle cell")
cell_ontology_id <- c("CL:0000115", "CL:0000057", NA, "CL:0000232", "CL:0002350", "CL:0000746")
tiss@meta.data[,'cell_ontology_class'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = cell_ontology_class)
tiss@meta.data[,'cell_ontology_id'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = cell_ontology_id)
tiss@meta.data[tiss@cell.names,'cell_ontology_class'] <- as.character(tiss@meta.data$cell_ontology_class)
tiss@meta.data[tiss@cell.names,'cell_ontology_id'] <- as.character(tiss@meta.data$cell_ontology_id)
TSNEPlot(object = tiss, do.label = TRUE, pt.size = 0.5, group.by='cell_ontology_class')
Color by metadata, like plate barcode, to check for batch effects.
TSNEPlot(object = tiss, do.return = TRUE, group.by = "channel")
TSNEPlot(object = tiss, do.return = TRUE, group.by = "mouse.sex")
Print a table showing the count of cells in each identity category from each plate.
table(as.character(tiss@ident), as.character(tiss@meta.data$channel))
10X_P7_4
0 177
1 147
2 96
3 81
4 63
5 60
We can repeat the above analysis on a subset of cells, defined using cluster IDs or some other metadata. This is a good way to drill down and find substructure.
# Subset data based on cluster id
subtiss <- SubsetData(object = tiss, ident.use = c(2), do.center = F, do.scale = F, cells.use = )
# To subset data based on cell_ontology_class or other metadata, you can explicitly pass cell names
#cells.to.use = tiss@cell.names[which(tiss@meta.data$mouse.sex == 'F')]
#subtiss <- SubsetData(object = tiss, cells.use = cells.to.use, do.center = F, do.scale = F)
subtiss <- NormalizeData(object = subtiss)
Performing log-normalization
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
subtiss <- ScaleData(object = subtiss, vars.to.regress = c("nUMI", "percent.ribo","Rn45s"))
[1] "Regressing out nUMI" "Regressing out percent.ribo"
[3] "Regressing out Rn45s"
|
| | 0%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 3%
|
|=== | 4%
|
|==== | 5%
|
|==== | 6%
|
|===== | 6%
|
|===== | 7%
|
|====== | 7%
|
|====== | 8%
|
|======= | 9%
|
|======== | 9%
|
|======== | 10%
|
|========= | 11%
|
|========= | 12%
|
|========== | 12%
|
|========== | 13%
|
|=========== | 13%
|
|=========== | 14%
|
|============ | 15%
|
|============= | 16%
|
|============= | 17%
|
|============== | 17%
|
|============== | 18%
|
|=============== | 18%
|
|=============== | 19%
|
|================ | 20%
|
|================ | 21%
|
|================= | 21%
|
|================= | 22%
|
|================== | 22%
|
|================== | 23%
|
|=================== | 24%
|
|==================== | 25%
|
|===================== | 26%
|
|====================== | 27%
|
|====================== | 28%
|
|======================= | 28%
|
|======================= | 29%
|
|======================== | 29%
|
|======================== | 30%
|
|========================= | 31%
|
|========================= | 32%
|
|========================== | 32%
|
|========================== | 33%
|
|=========================== | 33%
|
|=========================== | 34%
|
|============================ | 35%
|
|============================= | 36%
|
|============================= | 37%
|
|============================== | 37%
|
|============================== | 38%
|
|=============================== | 38%
|
|=============================== | 39%
|
|================================ | 40%
|
|================================ | 41%
|
|================================= | 41%
|
|================================== | 42%
|
|================================== | 43%
|
|=================================== | 43%
|
|=================================== | 44%
|
|==================================== | 44%
|
|==================================== | 45%
|
|===================================== | 46%
|
|===================================== | 47%
|
|====================================== | 47%
|
|====================================== | 48%
|
|======================================= | 48%
|
|======================================= | 49%
|
|======================================== | 50%
|
|========================================= | 51%
|
|========================================= | 52%
|
|========================================== | 52%
|
|========================================== | 53%
|
|=========================================== | 53%
|
|=========================================== | 54%
|
|============================================ | 55%
|
|============================================ | 56%
|
|============================================= | 56%
|
|============================================= | 57%
|
|============================================== | 57%
|
|============================================== | 58%
|
|=============================================== | 59%
|
|================================================ | 59%
|
|================================================ | 60%
|
|================================================= | 61%
|
|================================================= | 62%
|
|================================================== | 62%
|
|================================================== | 63%
|
|=================================================== | 63%
|
|=================================================== | 64%
|
|==================================================== | 65%
|
|===================================================== | 66%
|
|===================================================== | 67%
|
|====================================================== | 67%
|
|====================================================== | 68%
|
|======================================================= | 68%
|
|======================================================= | 69%
|
|======================================================== | 70%
|
|======================================================== | 71%
|
|========================================================= | 71%
|
|========================================================= | 72%
|
|========================================================== | 72%
|
|========================================================== | 73%
|
|=========================================================== | 74%
|
|============================================================ | 75%
|
|============================================================= | 76%
|
|============================================================== | 77%
|
|============================================================== | 78%
|
|=============================================================== | 78%
|
|=============================================================== | 79%
|
|================================================================ | 79%
|
|================================================================ | 80%
|
|================================================================= | 81%
|
|================================================================= | 82%
|
|================================================================== | 82%
|
|================================================================== | 83%
|
|=================================================================== | 83%
|
|=================================================================== | 84%
|
|==================================================================== | 85%
|
|===================================================================== | 86%
|
|===================================================================== | 87%
|
|====================================================================== | 87%
|
|====================================================================== | 88%
|
|======================================================================= | 88%
|
|======================================================================= | 89%
|
|======================================================================== | 90%
|
|======================================================================== | 91%
|
|========================================================================= | 91%
|
|========================================================================== | 92%
|
|========================================================================== | 93%
|
|=========================================================================== | 93%
|
|=========================================================================== | 94%
|
|============================================================================ | 94%
|
|============================================================================ | 95%
|
|============================================================================= | 96%
|
|============================================================================= | 97%
|
|============================================================================== | 97%
|
|============================================================================== | 98%
|
|=============================================================================== | 98%
|
|=============================================================================== | 99%
|
|================================================================================| 100%
[1] "Scaling data matrix"
|
| | 0%
|
|================================================================================| 100%
Run Principal Component Analysis.
subtiss <- FindVariableGenes(object = subtiss, do.plot = TRUE, x.high.cutoff = Inf, y.cutoff = 0.8)
Calculating gene means
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating gene variance to mean ratios
0% 10 20 30 40 50 60 70 80 90 100%
|----|----|----|----|----|----|----|----|----|----|
**************************************************|
subtiss <- RunPCA(object = subtiss, pcs.compute = 20, weight.by.var = F)
[1] "PC1"
[1] "Col3a1" "Fbln1" "Igfbp4" "Cfh" "Htra3"
[6] "B2m" "Gpx3" "Ifi27l2a" "Gas1" "Ifitm3"
[11] "Tmsb10" "Tbx20" "Col15a1" "Bgn" "6330406I15Rik"
[16] "Ms4a4d" "Tsc22d3" "Igfbp3" "Clec3b" "Ly6e"
[21] "Ccl19" "Xdh" "Cebpd" "Cyp1b1" "Scn7a"
[26] "Tmsb4x" "Smoc2" "Sfrp1" "Fmo2" "Marcks"
[1] ""
[1] "Mylk" "Acta2" "Olfr558" "Sncg" "Pcp4l1" "Myh11" "Tagln" "Rgs4"
[9] "Bcam" "Lmod1" "Rcan2" "Tpm2" "Nrip2" "ORF63" "Myl9" "Tinagl1"
[17] "Tpm1" "Palld" "Flna" "Mustn1" "Gpr20" "Nrarp" "Rgs5" "Kcna5"
[25] "Sh3bgr" "Tbx2" "Tcf15" "Pln" "Ramp1" "Cav1"
[1] ""
[1] ""
[1] "PC2"
[1] "Cpm" "Abcc9" "Colec11" "Kcnj8" "Car2" "Vtn" "Gpr30"
[8] "Ednrb" "Ctsc" "Myo1b" "Agtr1a" "Smagp" "Steap4" "Tfpi2"
[15] "P2ry14" "Rhox5" "Col4a2" "Trib2" "Nostrin" "Ifitm1" "Ndufa4l2"
[22] "Arhgdib" "Lin7a" "Sept4" "Hk1" "Cog7" "Ppp2r5b" "Gng11"
[29] "Lrrc51" "Hmgb2"
[1] ""
[1] "Fam89a" "Chl1" "Sox10" "Gpr37l1" "Nrn1" "Plp1" "Apod" "S100b"
[9] "Cd59b" "Itga4" "Nkd2" "Col28a1" "Lgi4" "Plekhb1" "Stmn1" "Fxyd7"
[17] "Nnat" "Cdh2" "Tagap1" "Aspa" "C4b" "Col18a1" "Psmc3ip" "Iqgap2"
[25] "Taf13" "Fxyd1" "Dbi" "Fam19a5" "Cryab" "Gfra3"
[1] ""
[1] ""
[1] "PC3"
[1] "Ankrd32" "Pan2" "Prmt7" "Gbp6" "Igtp" "Pvrl1" "Khnyn" "Il1r1"
[9] "Ocrl" "Pias2" "Sfxn2" "Zbtb6" "Ikbkap" "Lbr" "Cherp" "Csdc2"
[17] "Cse1l" "Kcnc2" "Cenpv" "Wbscr27" "Tsr1" "Itga11" "Adar" "Optn"
[25] "Tor3a" "Slc3a2" "Enpp1" "Llgl1" "Adamts1" "Myo7a"
[1] ""
[1] "Tspan15" "Art3" "Cpm" "Rerg" "Colec11"
[6] "Fabp5" "Car2" "E130203B14Rik" "Fabp7" "Iqgap2"
[11] "Gpr30" "Dpysl2" "Chl1" "Sox10" "Fam89a"
[16] "Kcnj8" "Steap4" "Slc12a2" "Plekhb1" "Smagp"
[21] "Nrn1" "Ednrb" "Abcc9" "Apod" "Gpr37l1"
[26] "Agtr1a" "Vtn" "Lrrc51" "Plp1" "Ctsc"
[1] ""
[1] ""
[1] "PC4"
[1] "Sap30" "Col15a1" "Akt2" "Dusp1" "Efha2"
[6] "Slc4a4" "Prr12" "Ripk1" "Abhd13" "Mtap1s"
[11] "Angptl1" "Pcdh7" "Etv3" "Rad52" "Tubb4a"
[16] "Mfsd1" "Slc39a14" "Col4a3" "Cst3" "Ms4a4d"
[21] "1500001M20Rik" "Disp1" "Cxcl1" "Lrrcc1" "Fam55c"
[26] "Cdca4" "Adcyap1r1" "Rnf185" "Dchs1" "Sco2"
[1] ""
[1] "Usp18" "Pan2" "Ikbkap" "Kcnc2" "Wbscr27" "Armcx5" "Zfp58"
[8] "Csdc2" "Zfp35" "Crtc2" "Adar" "Syp" "Ptplad1" "Kdm2b"
[15] "Map3k3" "Zfp760" "Naa16" "Slc10a6" "Pomgnt1" "Ccdc91" "Itga11"
[22] "Khnyn" "Cenpv" "Fam160a2" "Ints6" "Pdzd2" "Bbc3" "Zfp39"
[29] "Myo7a" "Zfp944"
[1] ""
[1] ""
[1] "PC5"
[1] "Kcna1" "Gfra3" "Matn4" "Mal" "Moxd1"
[6] "Kcna2" "Cdh19" "Pdlim4" "Sema3b" "Gatm"
[11] "Ank3" "Lyz1" "Deptor" "Cnp" "Zswim6"
[16] "Cd59a" "Gpnmb" "Noa1" "Limch1" "Klk8"
[21] "Fst" "C030039L03Rik" "Uchl1" "Nudt7" "6230427J02Rik"
[26] "Pex5l" "Mbp" "Patz1" "Smarcd1" "Mtor"
[1] ""
[1] "Il17rd" "Nnat" "Psmc3ip" "Noc3l" "Gng2"
[6] "Alkbh3" "Rp2h" "1810029B16Rik" "Sbk1" "Plekhg1"
[11] "Rbm15" "Vps45" "Pop7" "Wiz" "Fggy"
[16] "Prep" "4931406C07Rik" "Lars" "Bloc1s3" "Zfp354a"
[21] "Ntn4" "Mon1b" "Kif3c" "Slc10a6" "Arhgef19"
[26] "Kctd15" "2810432L12Rik" "Rps19bp1" "Bpnt1" "B3galt6"
[1] ""
[1] ""
subtiss <- ProjectPCA(object = subtiss, do.print = FALSE)
# If this fails for your subset, it may be that cells.use is more cells than you have left! Try reducing it.
PCHeatmap(object = subtiss, pc.use = 1:3, cells.use = 70, do.balanced = TRUE, label.columns = FALSE, num.genes = 12)
Later on (in FindClusters and TSNE) you will pick a number of principal components to use. This has the effect of keeping the major directions of variation in the data and, ideally, supressing noise. There is no correct answer to the number to use, but a decent rule of thumb is to go until the plot plateaus.
PCElbowPlot(object = subtiss)
Choose the number of principal components to use.
# Set number of principal components.
sub.n.pcs = 5
The clustering is performed based on a nearest neighbors graph. Cells that have similar expression will be joined together. The Louvain algorithm looks for groups of cells with high modularity–more connections within the group than between groups. The resolution parameter determines the scale…higher resolution will give more clusters, lower resolution will give fewer.
# Set resolution
sub.res.used <- 1
subtiss <- FindClusters(object = subtiss, reduction.type = "pca", dims.use = 1:sub.n.pcs,
resolution = sub.res.used, ,print.output = 0, save.SNN = TRUE)
To visualize
# If cells are too spread out, you can raise the perplexity. If you have few cells, try a lower perplexity (but never less than 10).
subtiss <- RunTSNE(object = subtiss, dims.use = 1:sub.n.pcs, seed.use = 10, perplexity=20)
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = subtiss, do.label = T)
subtiss.markers <- FindAllMarkers(object = subtiss, only.pos = TRUE, min.pct = 0.25, thresh.use = 0.25)
| | 0 % ~calculating
|+ | 1 % ~02s
|++ | 2 % ~03s
|++ | 3 % ~03s
|+++ | 4 % ~03s
|+++ | 5 % ~03s
|++++ | 6 % ~02s
|++++ | 7 % ~02s
|+++++ | 8 % ~02s
|+++++ | 9 % ~02s
|++++++ | 10% ~02s
|++++++ | 11% ~02s
|+++++++ | 12% ~02s
|+++++++ | 13% ~02s
|++++++++ | 14% ~02s
|++++++++ | 15% ~02s
|+++++++++ | 16% ~02s
|+++++++++ | 17% ~02s
|++++++++++ | 18% ~02s
|++++++++++ | 19% ~02s
|+++++++++++ | 20% ~02s
|+++++++++++ | 21% ~02s
|++++++++++++ | 22% ~02s
|++++++++++++ | 23% ~02s
|+++++++++++++ | 24% ~02s
|+++++++++++++ | 26% ~02s
|++++++++++++++ | 27% ~02s
|++++++++++++++ | 28% ~02s
|+++++++++++++++ | 29% ~02s
|+++++++++++++++ | 30% ~02s
|++++++++++++++++ | 31% ~02s
|++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|+++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|+++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|+++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|+++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|+++++++++++++++++++++++++ | 50% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|+++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|++++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|+++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|++++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|+++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|++++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|+++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|++++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|+++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|++++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 02s
| | 0 % ~calculating
|+ | 1 % ~01s
|++ | 2 % ~01s
|++ | 3 % ~01s
|+++ | 4 % ~01s
|+++ | 5 % ~01s
|++++ | 6 % ~01s
|++++ | 7 % ~01s
|+++++ | 8 % ~01s
|+++++ | 9 % ~01s
|++++++ | 11% ~01s
|++++++ | 12% ~01s
|+++++++ | 13% ~01s
|+++++++ | 14% ~01s
|++++++++ | 15% ~01s
|++++++++ | 16% ~01s
|+++++++++ | 17% ~01s
|+++++++++ | 18% ~01s
|++++++++++ | 19% ~01s
|++++++++++ | 20% ~01s
|+++++++++++ | 21% ~01s
|++++++++++++ | 22% ~01s
|++++++++++++ | 23% ~01s
|+++++++++++++ | 24% ~01s
|+++++++++++++ | 25% ~01s
|++++++++++++++ | 26% ~01s
|++++++++++++++ | 27% ~01s
|+++++++++++++++ | 28% ~01s
|+++++++++++++++ | 29% ~01s
|++++++++++++++++ | 31% ~01s
|++++++++++++++++ | 32% ~01s
|+++++++++++++++++ | 33% ~01s
|+++++++++++++++++ | 34% ~01s
|++++++++++++++++++ | 35% ~01s
|++++++++++++++++++ | 36% ~01s
|+++++++++++++++++++ | 37% ~01s
|+++++++++++++++++++ | 38% ~01s
|++++++++++++++++++++ | 39% ~01s
|++++++++++++++++++++ | 40% ~01s
|+++++++++++++++++++++ | 41% ~01s
|++++++++++++++++++++++ | 42% ~01s
|++++++++++++++++++++++ | 43% ~01s
|+++++++++++++++++++++++ | 44% ~01s
|+++++++++++++++++++++++ | 45% ~01s
|++++++++++++++++++++++++ | 46% ~01s
|++++++++++++++++++++++++ | 47% ~01s
|+++++++++++++++++++++++++ | 48% ~01s
|+++++++++++++++++++++++++ | 49% ~01s
|++++++++++++++++++++++++++ | 51% ~01s
|++++++++++++++++++++++++++ | 52% ~01s
|+++++++++++++++++++++++++++ | 53% ~01s
|+++++++++++++++++++++++++++ | 54% ~01s
|++++++++++++++++++++++++++++ | 55% ~01s
|++++++++++++++++++++++++++++ | 56% ~01s
|+++++++++++++++++++++++++++++ | 57% ~01s
|+++++++++++++++++++++++++++++ | 58% ~01s
|++++++++++++++++++++++++++++++ | 59% ~01s
|++++++++++++++++++++++++++++++ | 60% ~01s
|+++++++++++++++++++++++++++++++ | 61% ~01s
|++++++++++++++++++++++++++++++++ | 62% ~01s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|+++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|++++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|+++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~00s
|++++++++++++++++++++++++++++++++++++ | 72% ~00s
|+++++++++++++++++++++++++++++++++++++ | 73% ~00s
|+++++++++++++++++++++++++++++++++++++ | 74% ~00s
|++++++++++++++++++++++++++++++++++++++ | 75% ~00s
|++++++++++++++++++++++++++++++++++++++ | 76% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~00s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~00s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~00s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 82% ~00s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 84% ~00s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 86% ~00s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 02s
| | 0 % ~calculating
|+ | 1 % ~04s
|++ | 2 % ~04s
|++ | 3 % ~04s
|+++ | 4 % ~04s
|+++ | 5 % ~04s
|++++ | 6 % ~04s
|++++ | 7 % ~04s
|+++++ | 8 % ~03s
|+++++ | 9 % ~03s
|++++++ | 10% ~03s
|++++++ | 11% ~03s
|+++++++ | 12% ~03s
|+++++++ | 13% ~03s
|++++++++ | 14% ~03s
|++++++++ | 15% ~03s
|+++++++++ | 16% ~03s
|+++++++++ | 17% ~03s
|++++++++++ | 18% ~03s
|++++++++++ | 19% ~03s
|+++++++++++ | 20% ~03s
|+++++++++++ | 21% ~03s
|++++++++++++ | 22% ~03s
|++++++++++++ | 23% ~03s
|+++++++++++++ | 24% ~03s
|+++++++++++++ | 25% ~03s
|++++++++++++++ | 26% ~03s
|++++++++++++++ | 27% ~03s
|+++++++++++++++ | 28% ~03s
|+++++++++++++++ | 29% ~03s
|++++++++++++++++ | 30% ~03s
|++++++++++++++++ | 31% ~03s
|+++++++++++++++++ | 32% ~03s
|+++++++++++++++++ | 33% ~03s
|++++++++++++++++++ | 34% ~03s
|++++++++++++++++++ | 35% ~02s
|+++++++++++++++++++ | 36% ~02s
|+++++++++++++++++++ | 37% ~02s
|++++++++++++++++++++ | 38% ~02s
|++++++++++++++++++++ | 39% ~02s
|+++++++++++++++++++++ | 40% ~02s
|+++++++++++++++++++++ | 41% ~02s
|++++++++++++++++++++++ | 42% ~02s
|++++++++++++++++++++++ | 43% ~02s
|+++++++++++++++++++++++ | 44% ~02s
|+++++++++++++++++++++++ | 45% ~02s
|++++++++++++++++++++++++ | 46% ~02s
|++++++++++++++++++++++++ | 47% ~02s
|+++++++++++++++++++++++++ | 48% ~02s
|+++++++++++++++++++++++++ | 49% ~02s
|++++++++++++++++++++++++++ | 51% ~02s
|++++++++++++++++++++++++++ | 52% ~02s
|+++++++++++++++++++++++++++ | 53% ~02s
|+++++++++++++++++++++++++++ | 54% ~02s
|++++++++++++++++++++++++++++ | 55% ~02s
|++++++++++++++++++++++++++++ | 56% ~02s
|+++++++++++++++++++++++++++++ | 57% ~02s
|+++++++++++++++++++++++++++++ | 58% ~02s
|++++++++++++++++++++++++++++++ | 59% ~02s
|++++++++++++++++++++++++++++++ | 60% ~02s
|+++++++++++++++++++++++++++++++ | 61% ~02s
|+++++++++++++++++++++++++++++++ | 62% ~02s
|++++++++++++++++++++++++++++++++ | 63% ~01s
|++++++++++++++++++++++++++++++++ | 64% ~01s
|+++++++++++++++++++++++++++++++++ | 65% ~01s
|+++++++++++++++++++++++++++++++++ | 66% ~01s
|++++++++++++++++++++++++++++++++++ | 67% ~01s
|++++++++++++++++++++++++++++++++++ | 68% ~01s
|+++++++++++++++++++++++++++++++++++ | 69% ~01s
|+++++++++++++++++++++++++++++++++++ | 70% ~01s
|++++++++++++++++++++++++++++++++++++ | 71% ~01s
|++++++++++++++++++++++++++++++++++++ | 72% ~01s
|+++++++++++++++++++++++++++++++++++++ | 73% ~01s
|+++++++++++++++++++++++++++++++++++++ | 74% ~01s
|++++++++++++++++++++++++++++++++++++++ | 75% ~01s
|++++++++++++++++++++++++++++++++++++++ | 76% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 77% ~01s
|+++++++++++++++++++++++++++++++++++++++ | 78% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 79% ~01s
|++++++++++++++++++++++++++++++++++++++++ | 80% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 81% ~01s
|+++++++++++++++++++++++++++++++++++++++++ | 82% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 83% ~01s
|++++++++++++++++++++++++++++++++++++++++++ | 84% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 85% ~01s
|+++++++++++++++++++++++++++++++++++++++++++ | 86% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 87% ~01s
|++++++++++++++++++++++++++++++++++++++++++++ | 88% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s
|+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed = 04s
subtiss.markers %>% group_by(cluster) %>% top_n(6, avg_diff)
Check expression of genes of interset.
genes_to_check = c('Myh11','Dcn')
FeaturePlot(subtiss, genes_to_check, pt.size = 1)
Dotplots let you see the intensity of exppression and the fraction of cells expressing for each of your genes of interest.
# To change the y-axis to show raw counts, add use.raw = T.
DotPlot(subtiss, genes_to_check, plot.legend = T)
How big are the clusters?
table(subtiss@ident)
0 1 2
48 31 17
Color by metadata, like plate barcode, to check for batch effects.
TSNEPlot(object = subtiss, do.return = TRUE, group.by = "channel")
Print a table showing the count of cells in each identity category from each plate.
table(as.character(subtiss@ident), as.character(subtiss@meta.data$channel))
10X_P7_4
0 48
1 31
2 17
For the subsets, we produce subcell_ontology_classs. These will be written back as metadata in the original object, so we can see all subcell_ontology_classs together.
If some of the clusters you find in the subset deserve additional cell_ontology_class, you can add that right here. Use NA for clusters for which no subcell_ontology_class is needed.
subcluster.ids <- c(0, 1, 2)
subcell_ontology_class <- c("fibroblast", "fibroblast", "smooth muscle cell")
subcell_ontology_id = c("CL:0000057", "CL:0000057", "CL:0000192")
subtiss@meta.data[,'cell_ontology_class'] <- plyr::mapvalues(x = subtiss@ident, from = subcluster.ids, to = subcell_ontology_class)
subtiss@meta.data[,'cell_ontology_id'] <- plyr::mapvalues(x = subtiss@ident, from = subcluster.ids, to = subcell_ontology_id)
tiss@meta.data[subtiss@cell.names,'cell_ontology_class'] <- as.character(subtiss@meta.data$cell_ontology_class)
invalid factor level, NA generated
tiss@meta.data[subtiss@cell.names,'cell_ontology_id'] <- as.character(subtiss@meta.data$cell_ontology_id)
invalid factor level, NA generated
TSNEPlot(object = subtiss, do.label = TRUE, pt.size = 0.5, group.by='cell_ontology_class')
Check the numbers of cells per cell_ontology_class
table(tiss@meta.data$cell_ontology_class)
endothelial cell fibroblast Fb_SMC erythrocyte
177 226 0 81
endocardial cell cardiac muscle cell
63 60
When you save the annotated tissue, please give it a name.
filename = here('00_data_ingest', '04_tissue_robj_generated',
paste0("droplet", tissue_of_interest, "_seurat_tiss.Robj"))
print(filename)
[1] "/Users/guangli/Documents/GitHub/tabula-muris/00_data_ingest/04_tissue_robj_generated/dropletHeart_seurat_tiss.Robj"
save(tiss, file=filename)
# To reload a saved object
# filename = here('00_data_ingest', '04_tissue_robj_generated',
# paste0("facs", tissue_of_interest, "_seurat_tiss.Robj"))
# load(file=filename)
So that Biohub can easily combine all your cell_ontology_classs, please export them as a simple csv.
head(tiss@meta.data)
filename = here('00_data_ingest', '03_tissue_annotation_csv',
paste0(tissue_of_interest, "_annotation.csv"))
write.csv(tiss@meta.data[,c('channel','cell_ontology_class','cell_ontology_id')], file=filename)